﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using ViewMaker.Core.Utils;
using System.ComponentModel.Composition;
using ViewMaker.Core.ViewModels;
using ViewMaker.Core.Views;
using System.Windows.Markup;

namespace ViewMaker.Core.Silverlight
{
    [Export(typeof(IViewGenerateService))]
    public class SlChildWindowGenerateService : SlViewContentGenerateService, IViewGenerateService
    {

        public SlChildWindowGenerateService()
        {
        }

        public IView BuildWindowView(object viewModel, ViewLayoutItem layout = null, bool editable = true)
        {
            layout = GenerateViewLayout(viewModel, layout);
            var content = new ContentControl() { IsTabStop = false };
            BuildContent(content, viewModel, layout, editable);
            var view = new SlChildWindowView(content, layout, viewModel);
            return view;
        }

    }
}
